package com.kingsoft.dc.khaos.module.spark.constants

/**
  * Created by haorenhui on 2020/02/17.
  */
object RedisConstants {
    //连接方式枚举
    object RedisConnectEnum extends Serializable {
        val cluster = "cluster"
        val sentinel = "sentinel"
        val masterSlave = "masterSlave"
    }

    //存储的value类型
    object RedisValueEnum extends Serializable {
        val standard = "standard"  //标准json格式
        val value2key = "value2key" //csv格式
        val mix = "mix" //混合格式,既有json格式又有csv格式
        val uniqueValue = "uniqueValue" //hash类型时, 小key存储的是字段名称
    }

    //value枚举
    //none (key不存在)
    //string (字符串)
    //list (列表)
    //set (集合)
    //zset (有序集)
    //hash (哈希表)
    object RedisKeyEnum extends Serializable{
        val string = "string"
        val list = "list"
        val set = "set"
        val zset = "zset"
        val hash = "hash"
        val none = "none"
    }

    object RedisRoleEnum extends Serializable{
        val master:String = "master"
        val slave:String = "slave"
    }

    val isClearSyncData:String= "RedisSource.isClearSyncData"
    val clearSyncDataInfo:String = "RedisSource.connInfo"
    val clearSyncDataInfoConnectType:String = "RedisSource.connectType"
    val clearSyncDataInfoRedisNodes:String = "RedisSource.redisNodes"
    val clearSyncDataInfoRedisPassword:String = "RedisSource.redisPassword"
    val clearSyncDataInfoMasterName:String = "RedisSource.masterName"
    val clearSyncDataInfoKeys:String = "RedisSource.keys"


    //source算子配置
    val SOURCE_CONNECTTIMEOUT:String = "module.redis.source.connectTimeout"
    val SOURCE_SOTIMEOUT:String = "module.redis.source.soTimeout"
    val SOURCE_MAXTOTAL:String = "module.redis.source.maxTotal"
    val SOURCE_MAXIDLE:String = "module.redis.source.maxIdle"
    val SOURCE_MINIDLE:String = "module.redis.source.minIdle"
    val SOURCE_TESTONBORROW:String = "module.redis.source.testOnBorrow"
    val SOURCE_CLUSTER_MAXATTEMPTS:String = "module.redis.source.cluster.maxAttempts"
    val SOURCE_PER_SCAN_NUMS:String = "module.redis.source.per.scan.nums"
    val SOURCE_PARTITION_NUMS:String = "module.redis.source.partition.nums"
    val SOURCE_PER_HASHREAD_NUMS:String = "module.redis.source.per.hashRead.nums"

    //sink算子配置
    val SINK_CONNECTTIMEOUT:String = "module.redis.sink.connectTimeout"
    val SINK_SOTIMEOUT:String = "module.redis.sink.soTimeout"
    val SINK_MAXTOTAL:String = "module.redis.sink.maxTotal"
    val SINK_MAXIDLE:String = "module.redis.sink.maxIdle"
    val SINK_MINIDLE:String = "module.redis.sink.minIdle"
    val SINK_TESTONBORROW:String = "module.redis.sink.testOnBorrow"
    val SINK_CLUSTER_MAXATTEMPTS:String = "module.redis.sink.cluster.maxAttempts"
    val SINK_PER_ONCEMAXWRITE_NUMS:String = "module.redis.sink.per.onceMaxWrite.nums"

    //同步数据删除算子配置
    val DELETE_CONNECTTIMEOUT:String = "module.redis.delete.connectTimeout"
    val DELETE_SOTIMEOUT:String = "module.redis.delete.soTimeout"
    val DELETE_MAXTOTAL:String = "module.redis.delete.maxTotal"
    val DELETE_MAXIDLE:String = "module.redis.delete.maxIdle"
    val DELETE_MINIDLE:String = "module.redis.delete.minIdle"
    val DELETE_TESTONBORROW:String = "module.redis.delete.testOnBorrow"
    val DELETE_CLUSTER_MAXATTEMPTS:String = "module.redis.delete.cluster.maxAttempts"
    val DELETE_PER_DELETE_NUMS:String = "module.redis.delete.per.delete.nums"

    //jedis配置
    val JEDIS_CONNECTTIMEOUT:String = "module.redis.jedis.connectTimeout"
    val JEDIS_SOTIMEOUT:String = "module.redis.jedis.soTimeout"

    val DEFAULT_SOURCE_CONNECTTIMEOUT:String = "20000"
    val DEFAULT_SOURCE_SOTIMEOUT:String = "20000"
    val DEFAULT_SOURCE_MAXTOTAL:String = "50"
    val DEFAULT_SOURCE_MAXIDLE:String = "50"
    val DEFAULT_SOURCE_MINIDLE:String = "5"
    val DEFAULT_SOURCE_TESTONBORROW:String = "true"
    val DEFAULT_SOURCE_CLUSTER_MAXATTEMPTS:String = "5"
    val DEFAULT_SOURCE_PER_SCAN_NUMS:String = "1000"
    val DEFAULT_SOURCE_PARTITION_NUMS:String = "3"
    val DEFAULT_SOURCE_PER_HASHREAD_NUMS:String = "10000"

    val DEFAULT_SINK_CONNECTTIMEOUT:String = "20000"
    val DEFAULT_SINK_SOTIMEOUT:String = "20000"
    val DEFAULT_SINK_MAXTOTAL:String = "50"
    val DEFAULT_SINK_MAXIDLE:String = "50"
    val DEFAULT_SINK_MINIDLE:String = "5"
    val DEFAULT_SINK_TESTONBORROW:String = "true"
    val DEFAULT_SINK_CLUSTER_MAXATTEMPTS:String = "5"
    val DEFAULT_SINK_PER_ONCEMAXWRITE_NUMS:String = "10000"

    val DEFAULT_DELETE_CONNECTTIMEOUT:String = "20000"
    val DEFAULT_DELETE_SOTIMEOUT:String = "20000"
    val DEFAULT_DELETE_MAXTOTAL:String = "50"
    val DEFAULT_DELETE_MAXIDLE:String = "50"
    val DEFAULT_DELETE_MINIDLE:String = "5"
    val DEFAULT_DELETE_TESTONBORROW:String = "true"
    val DEFAULT_DELETE_CLUSTER_MAXATTEMPTS:String = "5"
    val DEFAULT_DELETE_PER_DELETE_NUMS:String = "10000"

    val DEFAULT_JEDIS_CONNECTTIMEOUT:String = "20000"
    val DEFAULT_JEDIS_SOTIMEOUT:String = "20000"
}
